package com.wg.dome.entity.user;


import com.wg.core.annotation.DataMember;
import com.wg.core.lang.HashTable;
import com.wg.db.annotation.EntityField;
import com.wg.db.annotation.EntityTable;

import java.io.Serializable;

/**
 * 玩家装备
 */
@EntityTable(tableName = "user_equip", isGrouping = true, groupName = "player_id")
public class EquipEntity implements Serializable {
    /**
     * 唯一id
     */
    @DataMember(code = 1)
    @EntityField(isKey = true)
    private long id;

    /**
     * 静态id
     */
    @DataMember(code = 2)
    @EntityField(fieldName = "s_id")
    private int sId;

    /**
     * 玩家id
     */
    @DataMember(code = 3)
    @EntityField(fieldName = "player_id")
    private long playerId;

    /**
     * 强化等级
     */
    @DataMember(code = 4)
    @EntityField(fieldName = "qh_level")
    private short qhLv;

    /**
     * 精炼等级
     */
    @DataMember(code = 5)
    @EntityField(fieldName = "jl_level")
    private short jlLv;

    /**
     * 灵石等级
     */
    @DataMember(code = 6)
    @EntityField(isSerialize = true)
    private short[] ls;

    /**
     * 注灵等级
     */
    @DataMember(code = 8)
    @EntityField(fieldName = "zl_level")
    private short zlLv;

    /**
     * 穿戴后的阵位
     */
    @DataMember(code = 9)
    @EntityField
    private byte pos;

    public EquipEntity() {
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public int getsId() {
        return sId;
    }

    public void setsId(int sId) {
        this.sId = sId;
    }

    public long getPlayerId() {
        return playerId;
    }

    public void setPlayerId(long playerId) {
        this.playerId = playerId;
    }

    public short getQhLv() {
        return qhLv;
    }

    public void setQhLv(short qhLv) {
        this.qhLv = qhLv;
    }

    public short getJlLv() {
        return jlLv;
    }

    public void setJlLv(short jlLv) {
        this.jlLv = jlLv;
    }

    public short[] getLs() {
        return ls;
    }

    public void setLs(short[] ls) {
        this.ls = ls;
    }

    public short getZlLv() {
        return zlLv;
    }

    public void setZlLv(short zlLv) {
        this.zlLv = zlLv;
    }

    public byte getPos() {
        return pos;
    }

    public void setPos(byte pos) {
        this.pos = pos;
    }

    public HashTable toHashTable() {
        HashTable hashTable = new HashTable(20);
        hashTable.put((byte) 1, id);
        hashTable.put((byte) 2, sId);
        hashTable.put((byte) 3, qhLv);
        hashTable.put((byte) 4, jlLv);
        hashTable.put((byte) 5, ls);
        hashTable.put((byte) 6, zlLv);
        hashTable.put((byte)7, pos);
        return hashTable;
    }
}
